{% load static %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>AC商城-注册</title>
	<link rel="stylesheet" type="text/css" href="/static/css/reset.css">
	<link rel="stylesheet" type="text/css" href="/static/css/main.css">
</head>

<body>
<div id="app">
	<div class="register_con">
		<div class="l_con fl">
			<a href="#" class="reg_logo"><img src="{% static 'images/logo.jpg' %}" width="250" height="85"></a>
			<div class="reg_slogan">欢迎光临几许商城</div>
			<div class="reg_slogan">中国好品质</div>
			<div class="reg_slogan">几许商城值得信赖</div>
			<div class="reg_slogan">欢迎你的到来</div>
			<div class="reg_banner"></div>
		</div>
		<div class="r_con fr">
			<div class="reg_title clearfix">
				<h1>用户注册</h1>
				<a href="login.html">登录</a>
			</div>
			<div class="reg_form clearfix">
				<form method="post" class="register_form" @submit="on_submit" v-cloak>
                    {% csrf_token %}
					<ul>
						<li>
							<label>用户名:</label>
							<input type="text" name="username" id="user_name"
                                   v-model="username" @blur="check_username">
                            <span class="error_tip" v-show="error_name">[[ error_name_message ]]</span>
						</li>
						<li>
							<label>密码:</label>
							<input type="password" name="password" id="pwd"
                                v-model="password" @blur="check_password">
							<span class="error_tip" v-show="error_password">请输入8-20位的密码</span>
						</li>
						<li>
							<label>确认密码:</label>
							<input type="password" name="password2"  id="cpwd"
                                v-model="password2" @blur="check_password2">
							<span class="error_tip" v-show="error_password2">两次输入的密码不一致</span>
						</li>
						<li>
							<label>手机号:</label>
							<input type="text" name="mobile"  id="phone"
                                v-model="mobile" @blur="check_mobile">
							<span class="error_tip" v-show="error_mobile">请输入正确的手机号码</span>
						</li>
						<li>
							<label>图形验证码:</label>
							<input type="text" name="image_code" id="pic_code" class="msg_input"
                                v-model="image_code" @blur="check_image_code">
							<img v-bind:src="image_code_url" alt="图形验证码" class="pic_code"
                                @click="generate_image_code">
{#							<span class="error_tip" v-show="error_image_code">请填写图形验证码</span>#}
                            <span style="display: inline-block; width: 100px;"></span>
                            <span style="color: red" v-if="error_pic_code" class="error-message" class="error_tip">[[ error_sms_code_message ]]</span>

						</li>


						<li>
							<label>短信验证码:</label>
							<input type="text" name="sms_code" id="msg_code" class="msg_input"
                                v-model="sms_code" @blur="check_sms_code">
							<a @click="send_sms_code" class="get_msg_code">[[ sms_code_tip ]]</a>
{#							<span class="error_tip" v-show="error_sms_code">请填写短信验证码</span>#}
                            <!-- 获取后端校验短信验证码的异常信息 -->
                            {% if sms_code_errmsg %}
                                <span style="color: red">{{ sms_code_errmsg }}</span>
                            {% endif %}
						</li>
						<li class="agreement">
							<input type="checkbox" name="allow" id="allow"
                                v-model="allow" @change="check_allow">
							<label>同意”AC商城用户使用协议“</label>
							<span class="error_tip" v-show="error_allow">请勾选用户协议</span>
						</li>
						<li class="reg_sub">
							<input type="submit" value="注 册">
                            <!-- 获取后端校验表单数据的异常信息 -->
                            {% if forms_errmsg %}
                                <span style="color: red">{{ forms_errmsg }}</span>
                            {% endif %}
						</li>
					</ul>
				</form>
			</div>
		</div>
	</div>
	<div class="footer no-mp">
		<div class="foot_link">
			<a href="#">关于我们</a>
			<span>|</span>
			<a href="#">联系我们</a>
			<span>|</span>
			<a href="#">招聘人才</a>
			<span>|</span>
			<a href="#">友情链接</a>
		</div>
		<p>CopyRight © 2023 广东AC商业股份有限公司 All Rights Reserved</p>
		<p>电话：010-****283    粤ICP备*******9号</p>
	</div>
</div>
</body>
<script src="/static/js/vue-2.5.16.js"></script>
<script src="/static/js/axios-0.18.0.min.js"></script>
<script src="/static/js/common.js"></script>
<script src="/static/js/register.js"></script>
</html>